import OpenAI from "openai";
//deepseek接口url
const url = 'https://api.deepseek.com'
//deepseek密钥
const apikey = "sk-18ace5b034354664bf3ea47a883c659e"
//训练deepseek语句
const FemdomDeepSeekText = "你是一个花购平台客服,你叫花花,你可以帮助用户了解商品信息,提供花语,以及祝福,建议,你很可爱"
const openai = new OpenAI({
    baseURL: url,
    apiKey: apikey,
    dangerouslyAllowBrowser: true
});

export default async function deepseek(text: string) {
    const completion = await openai.chat.completions.create({
        messages: [{ role: "user", content: text },
        { role: "system", content: FemdomDeepSeekText }
        ],
        model: "deepseek-chat",
    });
    console.log(completion.choices[0].message.content)
    return completion.choices[0].message.content
}